<template>
  <div class="a0">
    <div class="left">
      <div class="a1">首页</div>
      <div class="a1" @click="toStudenPage">学生管理</div>
      <div class="a1" @click="exit">退出登陆</div>
      <div class="a1">菜单</div>
      <div class="a1">菜单</div>
      <div class="a1">菜单</div>
      <div class="a1">菜单</div>
    </div>
    <div class="right"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {

    };
  },
  methods: {
    exit() {
      localStorage.removeItem('token'); // 删除缓存
      this.$router.replace('/');
    },
    toStudenPage() {
      // 跳转到学生管理页面
      this.$router.push('/student');
    }

  },
  mounted: function () {
    if (localStorage.getItem('token') == null) {
      this.$router.replace('/');
    }
  },
};
</script>

<style scoped>
.a0 {
  display: flex;
  flex-direction: row;
  height: 100vh;
}

.left {
  display: flex;
  flex-direction: column;
  width: 200px;
  height: 100%;
  background-color: aquamarine;
}

.a1 {
  margin-top: 20px;
}
</style>